From 0c42eed2debd581485aafbebfd0e362352d3dab1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Aug 2004 03:39:06 +0000 Subject: [PATCH] Ref and sink the column. (gtk_combo_box_menu_destroy): Unref the column. Sun Aug 8 23:36:55 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref and sink the column. (gtk_combo_box_menu_destroy): Unref the column. Sun Aug 8 23:35:00 2004 Matthias Clasen * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): (gtk_drag_dest_add_text_targets): Don't leak a reference to the target list. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtkcombobox.c | 6 ++++++ gtk/gtkdnd.c | 10 ++++++++-- 6 files changed, 62 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba68a31ebe..c7453468f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Sun Aug 8 23:36:55 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref + and sink the column. + (gtk_combo_box_menu_destroy): Unref the column. + +Sun Aug 8 23:35:00 2004 Matthias Clasen + + * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): + (gtk_drag_dest_add_text_targets): Don't leak a reference + to the target list. + Sun Aug 8 22:52:26 2004 Matthias Clasen * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ba68a31ebe..c7453468f9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Sun Aug 8 23:36:55 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref + and sink the column. + (gtk_combo_box_menu_destroy): Unref the column. + +Sun Aug 8 23:35:00 2004 Matthias Clasen + + * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): + (gtk_drag_dest_add_text_targets): Don't leak a reference + to the target list. + Sun Aug 8 22:52:26 2004 Matthias Clasen * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ba68a31ebe..c7453468f9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Sun Aug 8 23:36:55 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref + and sink the column. + (gtk_combo_box_menu_destroy): Unref the column. + +Sun Aug 8 23:35:00 2004 Matthias Clasen + + * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): + (gtk_drag_dest_add_text_targets): Don't leak a reference + to the target list. + Sun Aug 8 22:52:26 2004 Matthias Clasen * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ba68a31ebe..c7453468f9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Sun Aug 8 23:36:55 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref + and sink the column. + (gtk_combo_box_menu_destroy): Unref the column. + +Sun Aug 8 23:35:00 2004 Matthias Clasen + + * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): + (gtk_drag_dest_add_text_targets): Don't leak a reference + to the target list. + Sun Aug 8 22:52:26 2004 Matthias Clasen * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 535b32538c..a146b01b20 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -2279,6 +2279,8 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box, /* the column is needed in tree_column_row_is_sensitive() */ combo_box->priv->column = gtk_tree_view_column_new (); + g_object_ref (combo_box->priv->column); + gtk_object_sink (GTK_OBJECT (combo_box->priv->column)); gtk_combo_box_sync_cells (combo_box, GTK_CELL_LAYOUT (combo_box->priv->column)); } @@ -2427,6 +2429,9 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box) combo_box->priv->arrow = NULL; combo_box->priv->separator = NULL; + g_object_unref (combo_box->priv->column); + combo_box->priv->column = NULL; + /* changing the popup window will unref the menu and the children */ } @@ -4301,6 +4306,7 @@ gtk_combo_box_set_active_iter (GtkComboBox *combo_box, path = gtk_tree_model_get_path (gtk_combo_box_get_model (combo_box), iter); gtk_combo_box_set_active_internal (combo_box, path); + gtk_tree_path_free (path); } /** diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 0f32280ba4..acdb9212fd 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -1039,10 +1039,13 @@ gtk_drag_dest_add_text_targets (GtkWidget *widget) GtkTargetList *target_list; target_list = gtk_drag_dest_get_target_list (widget); - if (!target_list) + if (target_list) + gtk_target_list_ref (target_list); + else target_list = gtk_target_list_new (NULL, 0); gtk_target_list_add_text_targets (target_list); gtk_drag_dest_set_target_list (widget, target_list); + gtk_target_list_unref (target_list); } /************************************************************* @@ -2203,10 +2206,13 @@ gtk_drag_source_add_text_targets (GtkWidget *widget) GtkTargetList *target_list; target_list = gtk_drag_source_get_target_list (widget); - if (!target_list) + if (target_list) + gtk_target_list_ref (target_list); + else target_list = gtk_target_list_new (NULL, 0); gtk_target_list_add_text_targets (target_list); gtk_drag_source_set_target_list (widget, target_list); + gtk_target_list_unref (target_list); } static void -- 2.30.2